home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wayzata's Best of Shareware PC/Windows 1
/
Wayzata's Best of Shareware for PC-Windows - Release 1 - Wayzata Technology (1993).iso
/
mac
/
ZIPPED
/
WINDOWS
/
MISCUTIL
/
MSGBAR10.ZIP
/
SOURCE.EXE
/
MB.C
next >
Wrap
C/C++ Source or Header
|
1992-12-29
|
5KB
|
213 lines
/****************************************************************************
* File Name: MB.C
* Purpose: This module contains all Functions supported by the
Message Bar library.
*
* Author: Paul King
* Revision
History
*
* Date Description
--------- -------------------------------------------------------
* 12/29/92 Original Version
****************************************************************************/
#define STRICT
#include <windows.h>
//Internal Global Variable
HINSTANCE hLib;
/**************************************************************************
* Function: InitMB(HWND, HINSTANCE, COLORREF, COLORREF, BOOL)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: BOOL
**************************************************************************/
BOOL InitMB(HWND hWnd, HINSTANCE hInst, COLORREF cr1, COLORREF cr2, BOOL b1)
{
BOOL (FAR *lpProc) (HWND, HINSTANCE, COLORREF, COLORREF, BOOL);
UINT fuErrorFlags;
//Load the MB Library DLL
fuErrorFlags = SetErrorMode (SEM_FAILCRITICALERRORS |
SEM_NOOPENFILEERRORBOX);
hLib = LoadLibrary ("MESSAGEB.DLL");
SetErrorMode (fuErrorFlags);
if (hLib < HINSTANCE_ERROR)
hLib = NULL;
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "InitMB");
if (lpProc != NULL)
return (*lpProc) (hWnd, hInst, cr1, cr2, b1);
}
return FALSE;
}
/**************************************************************************
* Function: KillMB(void)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: BOOL
**************************************************************************/
BOOL KillMB(void)
{
BOOL (FAR *lpProc) (void);
BOOL bOK = FALSE;
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "KillMB");
if (lpProc != NULL)
{
bOK = (*lpProc) ();
FreeLibrary (hLib);
}
}
return bOK;
}
/**************************************************************************
* Function: ResizeMB(void)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: void
**************************************************************************/
void ResizeMB(void)
{
void (FAR *lpProc) (void);
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "ResizeMB");
if (lpProc != NULL)
(*lpProc) ();
}
}
/**************************************************************************
* Function: ColorMB(WPARAM, LPARAM)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: LRESULT
**************************************************************************/
LRESULT ColorMB(WPARAM wParam, LPARAM lParam)
{
LRESULT (FAR *lpProc) (WPARAM, LPARAM);
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "ColorMB");
if (lpProc != NULL)
return (*lpProc) (wParam, lParam);
}
return (LRESULT) 0L;
}
/**************************************************************************
* Function: MBText(LPSTR)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: void
**************************************************************************/
void MBText(LPSTR lpszText)
{
void (FAR *lpProc) (LPSTR);
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "MBText");
if (lpProc != NULL)
(*lpProc) (lpszText);
}
}
/**************************************************************************
* Function: MBShow(BOOL)
* Purpose: Cover wrapper for the message bar DLL
*
* Returns: void
**************************************************************************/
void MBShow(BOOL b1)
{
void (FAR *lpProc) (BOOL);
if (hLib != NULL)
{
(FARPROC) lpProc = GetProcAddress (hLib, "MBShow");
if (lpProc != NULL)
(*lpProc) (b1);
}
}